package service.impl;

import dao.UserDao;
import dao.impl.DaoImpl;
import domain.User;
import service.UserService;

import java.util.List;

public class UserServiceImpl implements UserService {
    UserDao dao = new DaoImpl();

    @Override
    public List<User> findList() {
        //接收来自web的数据
        List<User> list = dao.findList();
        return list;
    }

    @Override
    public boolean deleteById(String id) {
        boolean boo = dao.deleteById(id);
        return boo;
    }

    @Override
    public User findById(String id) {
        User user = dao.findById(id);
        return user;
    }

    @Override
    public boolean updateUser(User user) {
        boolean boo = dao.updateUser(user);
        return boo;
    }

    @Override
    public boolean addUser(User user) {
        boolean boo = dao.addUser(user);
        return boo;
    }

    @Override
    public List<User> queryPage(int offset, int count) {
        List<User> list = dao.queryPage(offset,count);
        return list;
    }

    @Override
    public int findSum() {
        int pageSum = dao.findSum();
        return pageSum;
    }
}
